import request from '@/utils/request'
import type { CategoryResponse } from './types/category'

// enum API {
// 	//这里添加接口地址
//     LOGIN_URL = '/shop/category'
	
// }

export const getCategoryList = () => {
    return request.get<CategoryResponse, CategoryResponse>('/shop/category')
}


// 添加前台小程序的金刚区
export const addCategory = (params: any) => {
    return request.post<CategoryResponse, CategoryResponse>('/shop/category', {
        name: params.name,
        url: params.url,
        color: params.color,
    });
};

// 修改前台小程序的金刚区
export const updateCategory = (params: any) => {
    return request.put<CategoryResponse, CategoryResponse>('/shop/category', {
        id: params.id,
        name: params.name,
        url: params.url,
        color: params.color,
    });
};
// 删除前台小程序的金刚区
export const deleteCategory = (params: any) => {
    return request.delete<CategoryResponse, CategoryResponse>('/shop/category', {
        data: {
            id: params.id
        }
    });
};
